﻿<?=$this->load->view('include_header',null)?>
	<div id="top-panel">
		<div id="panel">
			<ul>
				<li class="current"><a href="<?=site_url('archive/idcard/'.$id)?>" class="report"><?=(empty($id))?"录入新":"编辑"?>客户基本信息</a></li>
				
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="content">
			<div id="box">
			<form id="form" name="form" method="POST" action="<?=site_url('archive/property_update/'.$cateid)?>">
			<fieldset>
			<legend>房产证 Title Deeds</legend>
			
			<label>房权证 <BR>Title:</label><input type="text" name="fangquanzheng" value="<?=@$info->fangquanzheng?>" /> <br /><BR>
			<label>字 <BR>Zi:</label><input type="text" name="zi" value="<?=@$info->zi?>" /> <br /> <BR>
			<label>号 <BR>No.:</label><input type="text" name="hao" value="<?=@$info->hao?>" /> <br /> <BR>
			<label>发证机关<BR>Issued by:</label><input type="text" name="issued_by" size="50" value="<?=@$info->issued_by?>" /> <br /><BR>
			<hr />
			<label>房主<BR>Owner:</label><input type="text" name="owner" value="<?=@$info->owner?>"/> <br /> <BR>
			<label>房址<BR>Location:</label><input type="text" name="address" size="50" value="<?=@$info->address?>"/> <br /> <BR>
			<label>地号<BR>Land No.:</label><input type="text" name="ground_no" value="<?=@$info->ground_no?>"/> <br />  <BR>
			<label>房产性质<BR>Classification:</label><select type="text" name="clasification" value="<?=@$info->clasification?>" style="background: #FFFFC0;"><option>-</option></select> <br />
			<hr /> <BR>
			<label>楼号<BR>Building No.:</label><input type="text" name="house_no" value="<?=@$info->house_no?>"/> <br /><BR>
			<label>房号<BR>Room No.:</label><input type="text" name="room_no" value="<?=@$info->room_no?>"/> <br />  <BR>
			<label>建筑结构<BR>Building's Structure:</label><select type="text" name="structure" value="<?=@$info->structure?>" style="background: #FFFFC0;"><option>-</option></select> <br />  <BR>
			<label>总楼层<BR>Total Floors:</label><input type="text" name="total_floor" value="<?=@$info->total_floor?>"/> <br />  <BR>
			<label>楼层<BR>Floor:</label><input type="text" name="floor" value="<?=@$info->floor?>"/> <br />   <BR>
			<label>面积<BR>Gross Area:</label><input type="text" name="area" value="<?=@$info->area?>"/> <br />   <BR>
			<label>设计用途<BR>Designed Purpose:</label><select type="text" name="purpose" value="<?=@$info->purpose?>" style="background: #FFFFC0;"><option>-</option></select> <br /><BR>
			<hr>     <BR>
			设定他项权利摘要　Summary of other right enactment<br />   <BR>
			<label>权利人 <BR>Obligee1:</label><input type="text" name="obligee1" value="<?=@$info->obligee1?>" /> <br />  <BR>
			<label>权利种类 <BR>Type of Right:</label><input type="text" name="kind1" value="<?=@$info->kind1?>" /> <br /> <BR>
			<label>权利范围 <BR>Scope of Right:</label><input type="text" name="range1" value="<?=@$info->range1?>" /> <br />  <BR>
			<label>权利价值 <BR>Evaluation(Yuan):</label><input type="text" name="right_value1" value="<?=@$info->right_value1?>" /> <br />  <BR>
			<label>设定日期 <BR>Date of Enactment:</label><input type="text" name="enactment_date1" id="enactment_date1" value="<?=@$info->enactment_date1?>" /> <br /><BR>
			<label>约定期限<BR> Agreed Period:</label><input type="text" name="time_limit1" value="<?=@$info->time_limit1?>" /> <br />  <BR>
			<label>注销日期 <BR>Date of Cancellation:</label><input type="text" name="cancel_date1" id="cancel_date1" value="<?=@$info->cancel_date1?>" /> <br /> <BR>
			<br />  <BR>
			<label>权利人 <BR>Obligee1:</label><input type="text" name="obligee2" value="<?=@$info->obligee2?>" /> <br />  <BR>
			<label>权利种类<BR> Type of Right:</label><input type="text" name="kind2" value="<?=@$info->kind2?>" /> <br /> <BR>
			<label>权利范围 <BR>Scope of Right:</label><input type="text" name="range2" value="<?=@$info->range2?>" /> <br />  <BR>
			<label>权利价值 <BR>Evaluation(Yuan):</label><input type="text" name="right_value2" value="<?=@$info->right_value2?>" /> <br /><BR>
			<label>设定日期 <BR>Date of Enactment:</label><input type="text" name="enactment_date2" value="<?=@$info->enactment_date2?>" /> <br />   <BR>
			<label>约定期限<BR> Agreed Period:</label><input type="text" name="time_limit2" value="<?=@$info->time_limit2?>" /> <br /> <BR>
			<label>注销日期 <BR>Date of Cancellation:</label><input type="text" name="cancel_date2" value="<?=@$info->cancel_date2?>" /> <br />   <BR>
			<hr />    <BR>
			<label>附记 <BR>Excursus:</label><textarea name="note" cols="50" rows="5"><?=@$info->note?></textarea> <br />   <BR>
			<hr />       <BR>
			
			<label>Issued by:</label><input type="text" name="chapter" size="40" value="<?=@$info->chapter?>" /> <br />
			<label>Date of issue:</label><input type="text" name="issue_date" id="issue_date" value="<?=@$info->issue_date?>" /> <br />
			
			<input type="hidden" name="id" value="<?=$id?>" />
			<input id="button1" type="submit" value="提交信息 Continue" />
			<input id="button2" type="reset" value="重置 Cancel" />
			</fieldset>
			</form>
			</div>

		</div>
		
		<?=$this->load->view('include_sidebar',array('id'=>$id,'forms'=>$forms))?>
	</div>

	<script type="text/javascript">
	$().ready(function() {
	  $("#form").validate({
		rules: {
			hao:{
			 required:true
			},
			owner:{
			 required:true
			},
			address:{
			 required:true
			}
		}
	  });
      
      
       $.datepicker.setDefaults(
            {
            dateFormat: 'dd/mm/yy'
            }
        );
        
		$( "#issue_date" ).datepicker({
			changeMonth: true,
			changeYear: true,
			showOn: "both",
			buttonImage: "images/calendar.gif",
			buttonImageOnly: true

		});
        
        $( "#enactment_date1" ).datepicker({
            changeMonth: true,
            changeYear: true,
            showOn: "both",
            buttonImage: "images/calendar.gif",
            buttonImageOnly: true

        });
        
        $( "#cancel_date1" ).datepicker({
            changeMonth: true,
            changeYear: true,
            showOn: "both",
            buttonImage: "images/calendar.gif",
            buttonImageOnly: true

        });  
        
        get_select_options(f.structure, structure_arr, '<?=@$info->structure?>');
        get_select_options(f.purpose, purpose_arr, '<?=@$info->purpose?>');  
        get_select_options(f.clasification, clasification_arr, '<?=@$info->clasification?>');
          
	});
    
    var f = document.form;
    
     var structure_arr = {
        'Brick' : '砖混', 
        'Reinforced Concrete' : '钢混',
        'Others' : '其他'
    }
 
    var purpose_arr = {
        'Residential' : '住宅', 
        'Villa' : '别墅', 
        'Commercial' : '商业', 
        'Factory/Workshop' : '厂房'
    }
    
    var clasification_arr = {
        'State Owned Property' : '国有房产',  
        'Collective Property' : '集体房产',  
        'Private Property' : '私有房产',  
        'Joint- Stock Enterprises Property' : '股份制企业房产',  
        'Hongkong and Macau and Taiwan resident’s Property' : '港、澳、台胞房产',  
        'Foreign Owned Property' : '涉外房',  
        'Others' : '其他产'
    }

    function get_select_options(obj, kv, sv) {
        var arr = [];
        obj.options.length = 1;
        var i = 1;
        var selectedIndex = 0;
        for(var k in kv) {
            if(sv == k)  selectedIndex = i;
            obj.options[i++] = new Option(kv[k]+"-"+k, k);
        }
        obj.options.selectedIndex = selectedIndex;
    }   
	</script>
	
<?=$this->load->view('include_footer',null)?>
